/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import me.zhengjie.base.BaseCspImpEntity;
import me.zhengjie.base.BaseEntity;

import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://docs.auauz.net
* @description /
* @author 黄星星
* @date 2020-05-30
**/
@Entity
@Data
@Table(name="sys_area_permission")
public class AreaPermission extends BaseCspImpEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "主键")
    private Long id;


    @Column(name = "name")
    @ApiModelProperty(value = "权限方案名称")
    private String name;

    @Column(name = "description")
    @ApiModelProperty(value = "权限方案描述")
    private String description;

    @Column(name = "nez_area_id")
    @ApiModelProperty(value = "禁入区区域id")
    private Long nezAreaId;

    @Column(name = "nez_area_name")
    @ApiModelProperty(value = "禁入区区域姓名")
    private Long nezAreaName;

    @Column(name = "nez_break_into_alarm")
    @ApiModelProperty(value = "禁入区闯入报警 1 开 2.关")
    private Integer nezBreakIntoAlarm;

    @Column(name = "nez_alarm_level")
    @ApiModelProperty(value = "禁入区报警等级")
    private Integer nezAlarmLevel;

    @Column(name = "nez_no_entry_time")
    @ApiModelProperty(value = "禁入区禁入时间 1 无限制")
    private Integer nezNoEntryTime;

    @Column(name = "nez_no_entry_time_start")
    @ApiModelProperty(value = "禁入区禁入起始时间")
    private String nezNoEntryTimeStart;

    @Column(name = "nez_no_entry_time_end")
    @ApiModelProperty(value = "禁入区禁入结束时间")
    private String nezNoEntryTimeEnd;

    @Column(name = "nez_cycle")
    @ApiModelProperty(value = "禁入区禁入周期 数组格式")
    private String nezCycle;

    @Column(name = "az_area_id")
    @ApiModelProperty(value = "准入区区域id")
    private Long azAreaId;

    @Column(name = "az_area_name")
    @ApiModelProperty(value = "准入区区域姓名")
    private String azAreaName;

    @Column(name = "az_alarm_type")
    @ApiModelProperty(value = "离开报警 az_leave_alarm 滞留报警 az_delay_alarm")
    private String azAlarmType;

    @Column(name = "az_leave_alarm")
    @ApiModelProperty(value = "准入区离开报警 1 开 2.关")
    private Integer azLeaveAlarm;

    @Column(name = "az_alarm_level")
    @ApiModelProperty(value = "准入区报警等级")
    private Integer azAlarmLevel;

    @Column(name = "az_entry_time")
    @ApiModelProperty(value = "准入区准入时间 1 无限制")
    private Integer azEntryTime;

    @Column(name = "az_entry_time_start")
    @ApiModelProperty(value = "准入区准入起始时间")
    private String azEntryTimeStart;

    @Column(name = "az_entry_time_end")
    @ApiModelProperty(value = "准入区准入结束时间")
    private String azEntryTimeEnd;

    @Column(name = "az_entry_time_cycle")
    @ApiModelProperty(value = "准入区准入时间周期  数组格式")
    private String azEntryTimeCycle;

    @Column(name = "jz_area_id")
    @ApiModelProperty(value = "岗位区区域id")
    private Long jzAreaId;

    @Column(name = "jz_area_name")
    @ApiModelProperty(value = "岗位区区域名称")
    private String jzAreaName;

    @Column(name = "jz_leave_alarm")
    @ApiModelProperty(value = "岗位区离开报警 1 开 2关")
    private Integer jzLeaveAlarm;

    @Column(name = "jz_leave_alarm_level")
    @ApiModelProperty(value = "岗位区离开报警报警等级 1 2 3")
    private Integer jzLeaveAlarmLevel;

    @Column(name = "jz_skewers_alarm")
    @ApiModelProperty(value = "岗位串岗报警 1 开 2 关")
    private Integer jzSkewersAlarm;

    @Column(name = "jz_skewers_alarm_level")
    @ApiModelProperty(value = "岗位串岗报警报警等级 1 2 3")
    private Integer jzSkewersAlarmLevel;

    @Column(name = "jz_zg_time")
    @ApiModelProperty(value = "岗位区在岗时间 1 无限制")
    private Integer jzZgTime;

    @Column(name = "jz_zg_time_start")
    @ApiModelProperty(value = "岗位区在岗开始时间")
    private String jzZgTimeStart;

    @Column(name = "jz_zg_time_end")
    @ApiModelProperty(value = "岗位区在岗结束时间")
    private String jzZgTimeEnd;

    @Column(name = "jz_zg_cycle")
    @ApiModelProperty(value = "岗位区在岗周期 数组格式")
    private String jzZgCycle;

    public void copy(AreaPermission source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}